<?php

/**
 * CycleTestcases form base class.
 *
 * @package    form
 * @subpackage cycle_testcases
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseCycleTestcasesForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'idcycle'       => new sfWidgetFormInputHidden(),
      'idtestcase'    => new sfWidgetFormInputHidden(),
      'userid'        => new sfWidgetFormInputHidden(),
      'id'            => new sfWidgetFormInput(),
      'state'         => new sfWidgetFormDoctrineSelect(array('model' => 'StateEnum', 'add_empty' => true)),
      'bug'           => new sfWidgetFormInput(),
      'priority'      => new sfWidgetFormDoctrineSelect(array('model' => 'PriorityEnum', 'add_empty' => true)),
      'comments'      => new sfWidgetFormTextarea(),
      'executiondate' => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'idcycle'       => new sfValidatorDoctrineChoice(array('model' => 'CycleTestcases', 'column' => 'idcycle', 'required' => false)),
      'idtestcase'    => new sfValidatorDoctrineChoice(array('model' => 'CycleTestcases', 'column' => 'idtestcase', 'required' => false)),
      'userid'        => new sfValidatorDoctrineChoice(array('model' => 'CycleTestcases', 'column' => 'userid', 'required' => false)),
      'id'            => new sfValidatorInteger(),
      'state'         => new sfValidatorDoctrineChoice(array('model' => 'StateEnum', 'required' => false)),
      'bug'           => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'priority'      => new sfValidatorDoctrineChoice(array('model' => 'PriorityEnum', 'required' => false)),
      'comments'      => new sfValidatorString(array('max_length' => 2147483647, 'required' => false)),
      'executiondate' => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('cycle_testcases[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'CycleTestcases';
  }

}